<include file="Public/head"/>
<body class="no-skin">
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->


            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">


                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">

                        <div class="well well-sm" style="color: red">
                          {$message}
                        </div>

                        <!-- PAGE CONTENT BEGINS -->
                        <form id="query" class="form-inline" action="{:U('lists')}" method="get">
                            <div class="row">

                                <label class="inline">手机</label>
                                <input type="text" name="mobile" value="{:I(mobile)}" class="form-control">
                                <label class="inline">淘宝付款账户</label>
                                <input type="text" name="taobao_pay" value="{:I(taobao_pay)}" class="form-control">
                                <label class="inline">origin账号</label>
                                <input type="text" name="origin" value="{:I(origin)}" class="form-control">

                            </div>
                            <div class="row">
                                <label class="inline">时间</label>
                                <input class="form-control dates" name="time" value="{:I('time',date('Y-m-d'))}"
                                       type="text" data-date-format="dd-mm-yyyy">

                                <!--<input class="form-control dates" name="create_end" value="" type="text" data-date-format="dd-mm-yyyy">-->


                                <!--<label class="inline">处理时间</label>-->
                                <!--<input class="form-control dates"  name="dispose_start" value="" type="text" data-date-format="dd-mm-yyyy">-->
                                <!-- - -->
                                <!--<input class="form-control dates" name="dispose_end" value="" type="text" data-date-format="dd-mm-yyyy">-->


                                <label class="inline">状态</label>
                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    查询
                                </button>
                                <button onclick="location=location" type="button" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-globe  icon-on-right bigger-110"></span>
                                    刷新
                                </button>


                            </div>
                        </form>
                        <div class="space-4"></div>
                        <div class="row">
                            <form id="form" method="post" action="{:U('del')}">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <!--<th class="center"><input class="check-all" type="checkbox" value=""></th>-->
                                        <th>工单号</th>
                                        <th>淘宝付款账户</th>
                                        <th>手机</th>
                                        <th>origin账号</th>
                                        <th>系统</th>
                                        <th>备注</th>
                                        <th>创建时间</th>
                                        <th>更新时间</th>
                                        <th>更新用户</th>
                                        <th class="center">状态</th>
                                        <th class="center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <style>
                                        .grouptd {
                                            position: relative;
                                        }

                                        .group {
                                            display: inline-block;
                                            width: 100%;
                                        }

                                        .groupselect {
                                            position: absolute;
                                            top: 0;
                                            left: 0;
                                            width: 100%;
                                            height: 100%;
                                            border: 0;
                                        }
                                    </style>
                                    <volist name="list" id="val">
                                        <tr>
                                            <!--<td class="center">-->
                                            <!--<input class="uids" type="checkbox" name="uids[]" value="{$val['uid']}">-->
                                            <!--</td>-->
                                            <td> {$val.id}</td>
                                            <td> {$val.taobao_pay}</td>
                                            <td> {$val.mobile}</td>
                                            <td> {$val.origin}</td>
                                            <td> {$val.system}</td>
                                            <td> {$val.remark}</td>
                                            <td> {$val.create_time|time_to_date}</td>
                                            <td> {$val.update_time|time_to_date}</td>
                                            <td> {$val.update_user}</td>
                                            <td> {$val.status|o_p_s_to_str}</td>
                                            <td><a href="{:U('edit',array('id'=>$val[id]))}">修改</a> </td>

                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </form>
                            <div class="cf">

                            </div>
                            {$page}
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $(".group").click(function () {
            $(this).addClass('hide');
            $(this).parent().find(".groupselect").removeClass('hide');
        })
        $(".groupselect").on("change", function () {
            var ob = $(this);
            var gid = ob.val();
            var uid = ob.parent().find('.group').attr('val');
            $.get("{:U('update')}?ajax=yes&uid=" + uid + "&gid=" + gid, function (data) {
                var text = ob.find("option:selected").text();
                ob.parent().find(".group").removeClass('hide').html(text);
                ob.addClass('hide');
            });
        })

        $(".check-all").click(function () {
            $(".uids").prop("checked", this.checked);
        });
        $(".uids").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
        $("#submit").click(function () {
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除所选用户？",
                callback: function (result) {
                    console.log(result)
//                    if (result) {
//                        $("#form").submit();
//                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
        $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除该用户?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
    })
</script>


<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/qwadmin/js/function.js"></script>
<script type="text/javascript">
    jQuery(function ($) {
        $('.dates').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'cn'
        });
    });
</script>

<script>
    function exportOrder() {
        var data = $('#query');
        var tmpInput = $("<input id='exportOrder' type='hidden' name='exportOrder' value='1'/>");
        data.append(tmpInput);
        data.submit();
        $('#exportOrder').remove()
    }
</script>
</body>
</html>
